`include "./mips/ctrl.v"
`include "./mips/datapath.v"

module Mips(clk,rst);

    input      clk ;
    input      rst ;

    wire   [5:0]    funct ;
    wire   [31:26]  opcode;       

    wire   [1:0]    RegDst;     
    wire   [1:0]    Branch;   
    wire   [1:0]    MemtoReg;   
    wire            AluSrc;     
    wire   [3:0]    AluOp;      
    wire            MemWrite;  
    wire            RegWrite;  
    wire   [1:0]    Jump;       
    wire            Sign;
    wire   [31:0]   instr;    
    wire   [1:0]    DataType;
    wire            DataSign;
    
    assign opcode = instr[31:26];
    assign funct  = instr[5:0];
    Controller ctrl(opcode,funct,RegDst, Branch, MemtoReg,AluSrc, AluOp, MemWrite, RegWrite, Jump,Sign,DataType,DataSign);
    Datapath   datapath(RegDst, Branch, MemtoReg, AluOp, MemWrite, AluSrc, RegWrite, Jump,Sign,DataType,DataSign, clk, rst, instr);
    
endmodule
